package com.ftg.shopping.financeinfo.service;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.ftg.shopping.config.LayuiPage;
import com.ftg.shopping.financeinfo.entity.SpFinanceinfo;
import com.ftg.shopping.financeinfo.mapper.FinanceinfoMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class FinanceinfoService {

    @Autowired
    FinanceinfoMapper financeinfoMapper;

    public LayuiPage<SpFinanceinfo> layuipage(int page, int limit, String dname) {
        IPage<SpFinanceinfo> ip = new Page<>(page, limit);
        QueryWrapper qw = new QueryWrapper();
        qw.like("foodsbuln", dname);
        financeinfoMapper.selectPage(ip, dname == null || dname.equals("") ? null :  qw);
        return new LayuiPage<>(ip);

    }
}
